﻿Public Class MetisLookupListItem
    Implements IMetisCommonEntity

    Private _Annotation As String
    Private _ID As Integer
    Private _Name As String

    Public Event PropertyChanged(ByVal sender As Object, ByVal e As System.ComponentModel.PropertyChangedEventArgs) Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged

    Sub New(ByVal ID, ByVal Name, ByVal Annotation)
        _Annotation = Annotation
        _ID = ID
        _Name = Name
    End Sub

    Public Function GetNextID() As Integer Implements IMetisCommonEntity.GetNextID
        Return _ID
    End Function

    Public Property Annotation() As String Implements IMetisCommonEntity.Annotation
        Get
            Return _Annotation
        End Get
        Set(ByVal value As String)
            _Annotation = value
            RaiseEvent PropertyChanged(Me, New System.ComponentModel.PropertyChangedEventArgs("Annotation"))
        End Set
    End Property

    Public ReadOnly Property ID() As Integer Implements IMetisCommonEntity.ID
        Get
            Return _ID
        End Get
    End Property

    Public Property Name() As String Implements IMetisCommonEntity.Name
        Get
            Return _Name
        End Get
        Set(ByVal value As String)
            _Name = value
            RaiseEvent PropertyChanged(Me, New System.ComponentModel.PropertyChangedEventArgs("Name"))
        End Set
    End Property

    Public Function CompareTo(ByVal other As IMetisCommonEntity) As Integer Implements System.IComparable(Of IMetisCommonEntity).CompareTo
        Return String.Compare(_Name, other.Name, True)
    End Function

    Public Overrides Function ToString() As String
        Return _Name
    End Function
End Class
